package com.ruoyi.recipes.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recipes.mapper.RecipeSceneTagsMapper;
import com.ruoyi.recipes.domain.RecipeSceneTags;
import com.ruoyi.recipes.service.IRecipeSceneTagsService;

import javax.annotation.Resource;

/**
 * 菜谱与标签关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-15
 */
@Service
public class RecipeSceneTagsServiceImpl implements IRecipeSceneTagsService 
{
    @Resource
    private RecipeSceneTagsMapper recipeSceneTagsMapper;

    /**
     * 查询菜谱与标签关联
     * 
     * @param id 菜谱与标签关联主键
     * @return 菜谱与标签关联
     */
    @Override
    public RecipeSceneTags selectRecipeSceneTagsById(Long id)
    {
        return recipeSceneTagsMapper.selectRecipeSceneTagsById(id);
    }

    /**
     * 查询菜谱与标签关联列表
     * 
     * @param recipeSceneTags 菜谱与标签关联
     * @return 菜谱与标签关联
     */
    @Override
    public List<RecipeSceneTags> selectRecipeSceneTagsList(RecipeSceneTags recipeSceneTags)
    {
        return recipeSceneTagsMapper.selectRecipeSceneTagsList(recipeSceneTags);
    }

    /**
     * 新增菜谱与标签关联
     * 
     * @param recipeSceneTags 菜谱与标签关联
     * @return 结果
     */
    @Override
    public int insertRecipeSceneTags(RecipeSceneTags recipeSceneTags)
    {
        recipeSceneTags.setCreateTime(DateUtils.getNowDate());
        return recipeSceneTagsMapper.insertRecipeSceneTags(recipeSceneTags);
    }

    /**
     * 修改菜谱与标签关联
     * 
     * @param recipeSceneTags 菜谱与标签关联
     * @return 结果
     */
    @Override
    public int updateRecipeSceneTags(RecipeSceneTags recipeSceneTags)
    {
        return recipeSceneTagsMapper.updateRecipeSceneTags(recipeSceneTags);
    }

    /**
     * 批量删除菜谱与标签关联
     * 
     * @param ids 需要删除的菜谱与标签关联主键
     * @return 结果
     */
    @Override
    public int deleteRecipeSceneTagsByIds(Long[] ids)
    {
        return recipeSceneTagsMapper.deleteRecipeSceneTagsByIds(ids);
    }

    /**
     * 删除菜谱与标签关联信息
     * 
     * @param id 菜谱与标签关联主键
     * @return 结果
     */
    @Override
    public int deleteRecipeSceneTagsById(Long id)
    {
        return recipeSceneTagsMapper.deleteRecipeSceneTagsById(id);
    }
}
